package jam.UserInterface.UI;
import java.awt.List;

import javax.swing.*;
import jam.model.ClientModel;

public class UIController {
    static mainWindow main;
    public UIController(){
	    main = null;
	}
    
    
    // creates the main window
    public static void createMainWindow(final String nickname,  final ClientModel cl){
	SwingUtilities.invokeLater(new Runnable(){
		public void run(){
		    main = new mainWindow(nickname, cl);
		}
	    });
    }
    
    
    //updates the contact list in the main window
    public void updateContactList(String[][] contacts){
	//main.updateContacts(contacts);
    }
    
    
    // creates the login window
    public static void createLoginWindow(){
	SwingUtilities.invokeLater(new Runnable(){
		public void run(){
		    new loginWindow(); // creates the user interface
		}
	    });
    }
    
    public static  void incomingMessage(String user, String text){
	main.incomingMessage(user,text);
    }
    
    public void run() {
	createLoginWindow();
    }
    
}
